unit ufrmRegSoft;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons;

type
  TfrmRegSoft = class(TForm)
    btnOK: TBitBtn;
    btnCancel: TBitBtn;
    grpRegInfo: TGroupBox;
    lblCompanyName: TLabel;
    lblRegKey: TLabel;
    edtCompanyName: TEdit;
    edtRegKey: TEdit;
    procedure FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure FormKeyUp(Sender: TObject; var Key: Word;
      Shift: TShiftState);
  private
    fAltStr: string;
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmRegSoft: TfrmRegSoft;

implementation

uses uPubFuncs;

{$R *.dfm}

procedure TfrmRegSoft.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if (ssAlt in Shift) and (Key >= 48) and (Key <= 122) then
    fAltStr := fAltStr + Chr(Key);
  if UpperCase(fAltStr) = 'MINISOFT' then
    edtRegKey.Text := Encrypt(Encrypt(edtCompanyName.Text));
end;

procedure TfrmRegSoft.FormKeyUp(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if not (ssAlt in Shift) then fAltStr := '';
end;

end.
